﻿/*
*Json 0.1
*Copyright (c) 2009 AtHome
*Date:2012-10-24
*简化了一些与Json有关的操作
*/
(function ($) {
    $.Json_ = {
        changeTime: function (options) {
            var defaults = {
                toType: "0-0-0"
            }
            /*{
            data: string
            }*/
            var options = $.extend(defaults, options);
            var result = "";

            if (/^(.+)-(.+)-(.+)$/.test(options.toType)) {
                var date = new Date(parseInt(options.data.replace("/Date(", "").replace(")/", ""), 10));
                var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
                var currentDate = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
                result = date.getFullYear() + "-" + month + "-" + currentDate;
            }

            return result;
        }
    }
})(jQuery);